#ifndef UTIL_H
#define UTIL_H

#include <apr_general.h>
#include <apr_pools.h>
#include <apr_network_io.h>
#include "mpi.h"
#include "oom.h"

apr_status_t apr_socket_gets(char *str, int len, apr_socket_t *thesocket);
apr_status_t apr_socket_puts(const char *str, apr_socket_t *thesocket);
apr_status_t apr_socket_recv_full(apr_socket_t *thesocket, void *buf,
	apr_size_t nbytes, apr_size_t *bytes_received);
apr_status_t apr_socket_send_full(apr_socket_t *thesocket, void *buf,
		apr_size_t nbytes, apr_size_t *bytes_sent);
void set_status_empty(MPI_Status *status);
void set_status_from_request(MPI_Status *status, Request *request);

#endif
